// @ts-ignore
import request from '@/utils/request'

//注册用户 POST
export const Register = (data) => {
    return request.post('/user/register', data)
}

//获取项目信息 GET
export const GetProjecMessage = () => {
    return request.get('/user/userinfo')
}

//获取项目列表 GET
export const GetProjectList = () => {
    return request.get('/project/MyProjects')
}

//获取特定项目需求列表 GET
export const GetProjectNeedList = (id) => {
    return request.get(`/need/list/${id}`)
}

//获取特定项目缺陷列表 GET
export const GetProjectBugList = (id) => {
    return request.get(`/bug/${id}/bugsList`)
}

//获取特定项目成员列表 GET
export const GetProjectMemberList = (projectid) => {
    return request.get(`/project/member/${projectid}`)
}

//获取我的待办列表 GET
export const GetMyTodoList = () => {
    return request.get('/user/table/todo')
}

//获取我的已办列表 GET
export const GetMyDoneList = () => {
    return request.get('/user/table/done')
}

//获取我的创建列表 GET
export const GetMyCreateList = () => {
    return request.get('/user/table/create')
}

//创建项目 POST
export const createProject = (data) => {
    return request.post('/project/newProject', data)
}

//发布需求 POST
export const publishNeed = (data) => {
    return request.post('/need/publish', data)
}

//发布缺陷 POST
export const publishBug = (data) => {
    return request.post('/bug/publish', data)
}

//需求流转 POST
export const flowNeed = (data) => {
    return request.post('/need/roll', data)
}

//缺陷流转 POST
export const flowBug = (data) => {
    return request.post('/bug/roll', data)
}

//项目详情 GET
export const getProjectDetail = (params) => {
    return request.get('/getProjectDetail', { params })
}

//获取需求详情
export const getNeedDetail = (needId) => {
    return request.get(`/need/${needId}/detail`)
}

//获取缺陷详情
export const getBugDetail = (bugId) => {
    return request.get(`/bug/${bugId}/detail`)
}
